<template>
	<div>
			<el-form-item v-if="$check_register_field('add','name_of_expert','/expert_user/view')" label="专家姓名" prop="name_of_expert">
				<el-input id="name_of_expert" v-model="form['name_of_expert']" placeholder="请输入专家姓名" ></el-input>
				</el-form-item>
				<el-form-item v-if="$check_register_field('add','gender_of_experts','/expert_user/view')" label="专家性别" prop="gender_of_experts">
				<el-select id="gender_of_experts" v-model="form['gender_of_experts']">
			<el-option v-for="o in list_gender_of_experts" :key="o" :label="o" :value="o">
			</el-option>
		</el-select>
				</el-form-item>
				<el-form-item v-if="$check_register_field('add','expert_phone','/expert_user/view')" label="专家电话" prop="expert_phone">
				<el-input id="expert_phone" v-model="form['expert_phone']" placeholder="请输入专家电话" type="tel">
		</el-input>
				</el-form-item>
				<el-form-item v-if="$check_register_field('add','expert_certificate','/expert_user/view')" label="专家证书" prop="expert_certificate">
				<el-upload id="expert_certificate" class="avatar-uploader" drag
			accept="image/gif, image/jpeg, image/png, image/jpg" action="" :http-request="uploadimg_expert_certificate"
			:show-file-list="false" >
			<img v-if="form['expert_certificate']" :src="$fullUrl(form['expert_certificate'])" class="avatar">
			<i v-else class="el-icon-plus avatar-uploader-icon"></i>
		</el-upload>
				</el-form-item>
				<el-form-item v-if="$check_register_field('add','practitioner_experience','/expert_user/view')" label="从业经验" prop="practitioner_experience">
				<el-input id="practitioner_experience" v-model="form['practitioner_experience']" placeholder="请输入从业经验" ></el-input>
				</el-form-item>
				<el-form-item v-if="$check_register_field('add','areas_of_expertise','/expert_user/view')" label="擅长领域" prop="areas_of_expertise">
				<el-input id="areas_of_expertise" v-model="form['areas_of_expertise']" placeholder="请输入擅长领域" ></el-input>
				</el-form-item>
	
	</div>
</template>

<script>
	import mixin from "@/mixins/component.js";

	export default {
		mixins: [mixin],
		props:{

			form:{
				type: Object,
				default: function(){
					return {
							"name_of_expert":  '' ,
								"gender_of_experts":  '' ,
								"expert_phone":  '' ,
								"expert_certificate":  '' ,
								"practitioner_experience":  '' ,
								"areas_of_expertise":  '' ,
						}
				}
			},

		},
		data() {
			return {
				field: "expert_user_id",
				url_add: "~/api/expert_user/add?",
				url_set: "~/api/expert_user/set?",
				url_upload: "~/api/expert_user/upload?",

									list_gender_of_experts: ['男','女'],
														rules: {
					"name_of_expert": [    {required: true,message: '专家姓名不能为空'},  ],
					"gender_of_experts": [    {required: true,message: '专家性别不能为空'},  ],
					"expert_phone": [   {validator: this.$is_phone,trigger: 'blur'},   {required: true,message: '专家电话不能为空'},  ],
					"expert_certificate": [    {required: true,message: '专家证书不能为空'},  ],
					"practitioner_experience": [    {required: true,message: '从业经验不能为空'},  ],
					"areas_of_expertise": [    {required: true,message: '擅长领域不能为空'},  ],
				}

			}
		},
		methods: {
	
	
		
	
		
	
					/**
			 * 上传专家证书
			 * @param {Object} param 图片参数
			 */
			uploadimg_expert_certificate(param) {
								this.uploadFile(param.file, "expert_certificate");
							},
	
	
		
	
		
	
			},
		created() {
														}
	}
</script>
